﻿/**
 *
 * @file FITKAbaqusHDF5AdaptorPredefinedField.h
 * @brief 读写HDF5文件的PredefinedField类
 * @author fulipeng (fulipengqd@yeah.net)
 * @date 2024-07-04
 *
 */
#ifndef  _FITKABAQUSHDF5ADAPTORPREDEFINEDFIELD_H__
#define  _FITKABAQUSHDF5ADAPTORPREDEFINEDFIELD_H__

#include "FITKAbaqusIOHDF5API.h"
#include "FITKAbaqusHDF5AbstractAdaptor.h"
#include "FITK_Kernel/FITKAdaptor/FITKIOAdaptorFactory.h"
#include "FITK_Interface/FITKInterfaceIOHDF5/FITKInterfaceHDF5AdaptorBoundaryLocation.h"


 //前置声明
ForwardDeclarNS(Interface, FITKAbaAbstractPredefinedField)
ForwardDeclarNS(Interface, FITKAbaStepManager)

namespace IO
{
    /**
     * @brief HDF5 PredefinedField 预定义场 读写适配器
     * @author fulipeng (fulipengqd@yeah.net)
     * @date 2024-07-04
     */
    class FITKABAQUSIOHDF5API FITKAbaqusHDF5AdaptorPredefinedField : public FITKInterfaceHDF5AdaptorBoundaryLocation
    {
    public:
        explicit FITKAbaqusHDF5AdaptorPredefinedField() = default;
        virtual ~FITKAbaqusHDF5AdaptorPredefinedField() = default;

        /**
         * @brief 获取适配器数据类型名
         * @return 适配器数据类型名
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-07-04
         */
        QString getAdaptorClass() override;

        /**
         * @brief 设置管理器
         * @param stepManager 分析步管理器
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-06
         */
        void setStepManager(Interface::FITKAbaStepManager* stepManager);

        /**
         * @brief 适配器读取
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-07-04
         */
        bool adaptR() override;

        /**
         * @brief 适配器写出
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-07-04
         */
        bool adaptW() override;

        /**
         * @brief 读取预定义场
         * @param pf 预定义场
         * @param h5Group 数据块
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-07-04
         */
        bool readPredefinedField(Interface::FITKAbaAbstractPredefinedField* pf, H5::Group & h5Group);

        /**
         * @brief 写出预定义场
         * @param pf 预定义场
         * @param h5Group 数据块
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-07-04
         */
        bool writePredefinedField(Interface::FITKAbaAbstractPredefinedField* pf, H5::Group & h5Group);

        /**
         * @brief 读取预定义温度场
         * @param pf 预定义温度场
         * @param h5Group 数据块
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-07-04
         */
        bool readPredefinedFieldTemperature(Interface::FITKAbaAbstractPredefinedField* pf, H5::Group & h5Group);

        /**
         * @brief 写出预定义温度场
         * @param pf 预定义温度场
         * @param h5Group 数据块
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-07-04
         */
        bool writePredefinedFieldTemperature(Interface::FITKAbaAbstractPredefinedField* pf, H5::Group & h5Group);

        /**
         * @brief 读取预定义速度场
         * @param pf 预定义速度场
         * @param h5Group 数据块
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-07-04
         */
        bool readPredefinedFieldVelocity(Interface::FITKAbaAbstractPredefinedField* pf, H5::Group & h5Group);

        /**
         * @brief 写出预定义速度场
         * @param pf 预定义速度场
         * @param h5Group 数据块
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-07-04
         */
        bool writePredefinedFieldVelocity(Interface::FITKAbaAbstractPredefinedField* pf, H5::Group & h5Group);

    private:
        /**
         * @brief 分析步管理器
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-07-04
         */
        Interface::FITKAbaStepManager* _stepManager;
    };

    Register2FITKIOAdaptorFactory(HDF5, Interface::FITKAbaAbstractPredefinedField, FITKAbaqusHDF5AdaptorPredefinedField)

}

#endif
